#!/usr/bin/env python
PACKAGE = "roboteq_control"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("pwm_frequency",           double_t, 0, "[kHz] Frequency PWM motors",      10,  10, 30)

gen.add("over_voltage_limit",      double_t, 0, "[V] Over voltage limit",        10,  0, 60)
gen.add("over_voltage_hysteresis", double_t, 0, "[V] Over voltage histeresis",    5,   0, 25.5)
gen.add("under_voltage_limit",     double_t, 0, "[V] Under voltage limit",       10,  0, 60)

gen.add("break_delay",  int_t, 0, "[ms] Break activation delay",                250,  0, 65536)

mixing_mode = gen.enum([ gen.const("separate",        int_t, 0, "direct control channels"),
                         gen.const("mode_1", int_t,  1, "Mixed mode like tank - mode 1 (see reference)"),
                         gen.const("mode_2", int_t,  2, "Mixed mode like tank - mode 2 (see reference)"),
                         gen.const("mode_3", int_t,  3, "Mixed mode like tank - mode 3 (see reference)")],
                      "operation mode")
gen.add("mixing", int_t, 0, "Type of mixing mode", 0, 0, 3, edit_method=mixing_mode)

#Default command
gen.add("load_roboteq", bool_t  , 0, "Load all parameters from Roboteq board", False)
gen.add("restore_defaults", bool_t  , 0, "Restore to the original configuration", False)

# Maintenance commands
gen.add("factory_reset",    bool_t  , 0, "Factory reset the roboteq board", False)
gen.add("store_in_eeprom",  bool_t  , 0, "Store all parameters in EEPROM", False)
gen.add("load_from_eeprom", bool_t  , 0, "Load all parameters from EEPROM", False)

exit(gen.generate(PACKAGE, "roboteq_node", "RoboteqController"))
